﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Xml.Linq;
using System.IO;
using System.Web;

namespace DataAccess
{
    public class DBConnection
    {

        private string connString = "Data Source=localhost;Initial Catalog=THD;Integrated Security=True";
        private SqlConnection myConn; //Conexion.

        #region SINGLETON

        private static DBConnection unDBConn;
        public static DBConnection getInstancia()
        {
            if (unDBConn == null)
            {
                unDBConn = new DBConnection();
            }
            return unDBConn;
        }
        #endregion

        #region CONSTRUCTORES

        private DBConnection()
        {
            myConn = new SqlConnection(connString);
        }

        #endregion

        #region METODOS

        public SqlConnection getConnection()
        {
            return myConn;
        }

        #endregion

        
    }
}
